<?php
/**
 * @file
 * ccloud_custom_site_common.rules_defaults.inc
 */

/**
 * Implements hook_default_rules_configuration().
 */
function ccloud_custom_site_common_default_rules_configuration() {
  $items = array();
  $items['rules_grant_site_admin_role'] = entity_import('rules_config', '{ "rules_grant_site_admin_role" : {
      "LABEL" : "Grant \\u7ba1\\u7406\\u5458 role",
      "PLUGIN" : "action set",
      "OWNER" : "rules",
      "REQUIRES" : [ "rules" ],
      "ACCESS_EXPOSED" : "1",
      "USES VARIABLES" : { "user" : { "label" : "User", "type" : "user" } },
      "ACTION SET" : [
        { "user_add_role" : { "account" : [ "user" ], "roles" : { "value" : { "4" : "4" } } } }
      ]
    }
  }');
  $items['rules_revoke_site_admin_role'] = entity_import('rules_config', '{ "rules_revoke_site_admin_role" : {
      "LABEL" : "Revoke \\u7ba1\\u7406\\u5458 role",
      "PLUGIN" : "action set",
      "OWNER" : "rules",
      "REQUIRES" : [ "rules" ],
      "ACCESS_EXPOSED" : "1",
      "USES VARIABLES" : { "user" : { "label" : "User", "type" : "user" } },
      "ACTION SET" : [
        { "user_remove_role" : { "account" : [ "user" ], "roles" : { "value" : { "4" : "4" } } } }
      ]
    }
  }');
  $items['rules_user_login_redirect'] = entity_import('rules_config', '{ "rules_user_login_redirect" : {
      "LABEL" : "User login redirect",
      "PLUGIN" : "reaction rule",
      "OWNER" : "rules",
      "REQUIRES" : [ "rules" ],
      "ON" : { "user_login" : [] },
      "DO" : [ { "redirect" : { "url" : [ "site:url" ] } } ]
    }
  }');
  return $items;
}
